<?php

ini_set('max_execution_time', 999999999);
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db("player_profile", $con);

$select = "Select * from players where hometown like '%\r\n%' ";

$result = mysql_query($select);
$count = 0;

while($r = mysql_fetch_assoc($result)){
	$title = $r['hometown'];
	echo "'$title'<br>";
	$title = preg_replace("/\r\n/", "", $title);
	echo "'$title'<br>";
	$id = $r['id'];
	$update = "UPDATE players set hometown = '$title' where id=$id";
	echo $update."<br>";
	mysql_query($update);
	$count++;
}
echo "Updated $count errors";

?>